import request from "@/utils/request";
import requesta from '@/utils/requesta'
export function genCode(ruleCode) {
  return request({
    url: "/mes/md/autocode/get/" + ruleCode,
    method: "get",
  });
}

// 查询字典类型列表
export function listRule(query) {
  return request({
    url: "/mes/md/autocode/rule/list",
    method: "get",
    params: query,
  });
}

// 查询字典类型详细
export function getRule(ruleId) {
  return request({
    url: "/mes/md/autocode/rule/" + ruleId,
    method: "get",
  });
}

// 新增字典类型
export function addRule(data) {
  return request({
    url: "/mes/md/autocode/rule",
    method: "post",
    data: data,
  });
}

// 修改字典类型
export function updateRule(data) {
  return request({
    url: "/mes/md/autocode/rule",
    method: "put",
    data: data,
  });
}

// 删除字典类型
export function delRule(ruleId) {
  return request({
    url: "/mes/md/autocode/rule/" + ruleId,
    method: "delete",
  });
}

// 打印批次号
export function printBatchCode(data) {
  return requesta({
    url: "/hici/print/areaDevice", //'/mes/pro/workorderSn/print',
    method: "post",
    data: data,
  });
}
